package org.cs.mgr.before.dao.impl;

import java.util.List;
import java.util.Map;

import javax.xml.stream.events.Comment;

import org.cs.core.dao.impl.BaseDao;
import org.cs.mgr.before.dao.ICommmentDao;
import org.springframework.stereotype.Repository;
@Repository
public class CommentDao extends BaseDao<Comment> implements ICommmentDao{
	
	//通过goods的id查Comment表，返回一个list集合
	@Override
	public List<Map<String, Object>> getComment(String id) {
		List<Map<String, Object>> comments = this.findBySql("SELECT c.*, u.USER_NAME,u.USER_IMG,gs.GOODS_SPECIFICATION_NAME from comment as c, user as u,goods_specification as gs where c.USER_ID=u.ID and c.GOODS_ID=gs.GOODS_ID and c.GOODS_ID="+id+" GROUP BY u.USER_NAME");
		return comments;
	}
	         

}
